﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/HomeMaster.Master" AutoEventWireup="true" CodeBehind="ServiceCause.aspx.cs" Inherits="CSP.Web.MyHome.ServiceManage.ServiceCause" %>

<asp:Content ID="CSPHead" ContentPlaceHolderID="CSPHead" runat="server">
    <meta charset="utf-8">
    <title>产品信息管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
</asp:Content>
<asp:Content ID="CSPStyleAndScript" ContentPlaceHolderID="CSPStyleAndScript" runat="server">
    <link href="/Styles/lib/jquery-ui/jquery-ui-1.8.22.custom.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/lib/jquery-ui/jquery.ui.button.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/UI/Jquery/jquery.ui.core.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.widget.min.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.position.min.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.dialog.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Expand/dialog.js" type="text/javascript"></script>
    <script type="text/javascript">


        function DeleteInfo(id) {
            DialogMessage.ConfirmShow("提示", "确定要删除此条信息？", function () {
                $.ajax({
                    type: "get",
                    dataType: "json",
                    //data: { OrderNumber: ordernumber, ShipmentID:shipmentID, Notes: notes, Action: "CancelShipmentByID" },
                    url: "Detail.aspx?deleteid=" + id,
                    async: false,
                    error: function (result) {
                        result;
                    },
                    success: function (data, textStatus) {
                        data;
                        //执行成功
                        if (data.status == 1) {
                            DialogMessage.Show(1, data.msg, function () {
                                window.location.href = "Detail.aspx";
                            });
                        }
                        else if (data.status == 2)//警告
                        {
                            DialogMessage.Show(2, data.msg);
                        }
                        else {
                            DialogMessage.Show(0, data.msg);
                        }
                    }
                });
            });
        }

        function UpdateStatus(id, status) {
            var statusName = "上线";
            if (status == 1) {
                statusName = "下线";
            } else if (status == 2) {
                statusName = "上线";
            }
            DialogMessage.ConfirmShow("提示", "确定要更新为" + statusName + "状态", function () {
                $.ajax({
                    type: "get",
                    dataType: "json",
                    url: "Detail.aspx?updateid=" + id + "&status=" + status,
                    async: false,
                    error: function (result) {
                        result;
                    },
                    success: function (data, textStatus) {
                        data;
                        //执行成功
                        if (data.status == 1) {
                            DialogMessage.Show(1, data.msg, function () {
                                window.location.href = "List.aspx";
                            });
                        }
                        else if (data.status == 2)//警告
                        {
                            DialogMessage.Show(2, data.msg);
                        }
                        else {
                            DialogMessage.Show(0, data.msg);
                        }
                    }
                });
            });
        }

        //获取时间
        function GetLastTime(obj, sencond) {

            var sysSecond = sencond;
            if (sysSecond > 0) {
                sysSecond = sysSecond - 1;
                var second = Math.floor(sysSecond % 60);             // 计算秒     
                var minite = Math.floor((sysSecond / 60) % 60);      //计算分 
                var hour = Math.floor((sysSecond / 3600) % 24);      //计算小时 
                var day = Math.floor((sysSecond / 3600) / 24);        //计算天 

                obj.title = day + "天" + hour + "小时" + minite + "分" + second + "秒";
            } else {//剩余时间小于或等于0的时候，就停止间隔函数 
                obj.title = "0秒";
            }
        }
    </script>
    <script src="http://ui.operamasks.org/jquery.js" type="text/javascript"></script>
    <script type="text/javascript" src="http://ui.operamasks.org/ui/om-core.js"></script>
    <script type="text/javascript" src="http://ui.operamasks.org/ui/om-tree.js"></script>
    <script src="http://ui.operamasks.org/ui/om-mouse.js"></script>
    <script src="http://ui.operamasks.org/ui/om-resizable.js"></script>
    <script type="text/javascript" src="http://ui.operamasks.org/ui/om-grid.js"></script>
    <link rel="stylesheet" type="text/css" href="http://ui.operamasks.org/themes/default/om-all.css" />
    <link rel="stylesheet" type="text/css" href="http://ui.operamasks.org/demos/common/css/base.css" />
    <link rel="stylesheet" href="http://ui.operamasks.org/demos/common/css/demo.css">
    <!-- view_source_begin -->
    <script type="text/javascript">
        var typedata = [{
            "text": "个人",
            "value": "52",
            "expanded": true,
            "children": [{
                "text": "在职时间", "value": "69"
            }, {
                "text": "社保限制", "value": "78"
            }, {
                "text": "公积金限制", "value": "84"
            }, {
                "text": "家庭资产限制", "value": "88"
            }, {
                "text": "工资发放形式", "value": "92"
            }, {
                "text": "户籍", "value": "130"
            }, {
                "text": "单位性质限制", "value": "139"
            },
            {
                "text": "房产类型限制", "value": "193"
            }]
        }, {
            "text": "企业",
            "value": "53",
            "expanded": false,
            "children": [{
                "text": "经营注册地", "value": "55"
            }, {
                "text": "经营年限", "value": "58"
            }, {
                "text": "企业注册时间", "value": "149"
            }, {
                "text": "企业实际经营时间", "value": "156"
            }, {
                "text": "占股比例限制", "value": "179"
            }, {
                "text": "家人是否知晓", "value": "185"
            }, {
                "text": "每月经营收入", "value": "188"
            }]
        }, {
            "text": "年龄段",
            "expanded": true,
            "value": "52",
        },
        {
            "text": "名下房产",
            "expanded": true,
            "value": "52",
        },
        {
            "text": "名下车辆",
            "expanded": true,
            "value": "52",
        },
        {
            "text": "个人信用",
            "expanded": true,
            "value": "52",
        }, {
            "text": "提供资料",
            "expanded": true,
            "value": "52",
        }, ];

    </script>

    <script type="text/javascript">
        $(document).ready(function () {
            $("#navtree").omTree({
                dataSource: typedata,
                onSelect: function (nodedata) {
                    if (!nodedata.children && nodedata.value) {
                        //避免在IE浏览器下出现中文乱码
                        var url = encodeURI("http://localhost/MyHome/ServiceManage/getdata.aspx?id=" + nodedata.value);
                        $("#grid").omGrid("setData", url);
                    } else {
                        $("#grid").omGrid("setData", "http://localhost/MyHome/ServiceManage/getdata.aspx");
                    }
                }
            });
            $('#grid').omGrid({
                dataSource: 'http://localhost/MyHome/ServiceManage/getdata.aspx',
                limit: 10,
                height: 530,
                width: 600,
                colModel: [{ header: '序号', name: 'id', width: 20, align: 'center' },
                             { header: '名称', name: 'name', width: 120, align: 'left' },
                             { header: '排序', name: 'orderid', align: 'left', width: 40 },
                { header: '状态', name: 'status', align: 'left', width: 40 },
                { header: '修改', name: 'edit', align: 'left', width: 50 },
                { header: '删除', name: 'del', align: 'left', width: 50 }]
            });
        });
        function insertNode() {
            var node = {
                "text": "new tree node",
                "classes": "folder",
                "children": [{
                    "text": "new child node"
                }]
            };
            var pnode = $("#navtree").omTree("getSelected");
            $("#navtree").omTree("insert", node, pnode);
        }

        function rNode() {
            var node = $("#navtree").omTree("getSelected");
            $("#navtree").omTree("remove", node);
        }

        function modifyNode() {
            var node = $("#navtree").omTree("getSelected");
            var newnode = { "text": "modify tree node" };
            $("#navtree").omTree("modify", node, newnode);
        }
    </script>
    <!-- view_source_end -->
    <style type="text/css">
        #body-table {
            width: 660px;
            float: left;
            padding: 30px 20px;
            height: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="CSPCrumbs" ContentPlaceHolderID="CSPCrumbs" runat="server">
    <div class="crumbs">
        <span>您当前所在的位置：</span> <a href="/">首页</a> &gt; <a href="/MyHome/ServiceManage/Detail.aspx">产品管理</a> &gt; <span>产品限制条件管理</span>
    </div>
    <!--crumbs-->
    <!--crumbs-->
</asp:Content>
<asp:Content ID="CSPRight" ContentPlaceHolderID="CSPRight" runat="server">
    <div class="pr10">
        <div class="pr10 mh500">
            <div class="tabs tabs-home mt10">
                <div class="tabs-nd">
                    <ul class="tabs-hd">
                        <li class="trigger current">产品限制条件管理</li>
                    </ul>
                </div>
                <div class="tabs-bd order">
                    <div class="tabs-panel">
                        <!--thead-->
                        <div id="content" class="content">

                            <input id="addNode" onclick="insertNode();" type="button" value="新增分类" />
                            <input id="editNode" onclick="modifyNode();" type="button" value="修改分类" />
                            <input id="delNode" onclick="rNode();" type="button" value="删除分类" />
                            <br />
                            <table id="body-table">
                                <tr>
                                    <td class="left-panel" valign="top">
                                        <ul id="navtree">
                                        </ul>

                                    </td>
                                    <td class="center-panel" valign="top">
                                        <div style="float: left;">
                                            <table id="grid"></table>
                                        </div>

                                    </td>
                                </tr>

                            </table>
                        </div>
                    </div>
                    <!--tabs-panel-->
                </div>
                <!--tabs-bd-->
            </div>
            <!--tabs-->
        </div>
    </div>
</asp:Content>
